import request from '../utils/request-new'

// 获取我的案例列表
export const getMyCaseList = (data: {
  pageNum?: number,
  pageSize?: number,
  name?: string
}) => {
  return request({
    url: '/user/caseList',
    method: 'GET',
    data
  })
}

// 获取案例
export const getCaseList = (data: {
  pageNum?: number,
  pageSize?: number,
  name?: string
}) => {
  return request({
    url: '/case/list',
    method: 'GET',
    data
  })
}

// 获取案例详细
export const getCaseDetail = (data: {
  caseId: string
}) => {
  return request({
    url: `/case/${data.caseId}`,
    method: 'GET',
    data
  })
}

// 报名
export const joinConference = (data: {
  conferenceId: string
}) => {
  return request({
    url: `/case/sign`,
    method: 'POST',
    data
  })
}

// 主题列表
export const getTopicalList = (data: {
  pageNo: number,
  pageSize: number,
  caseId: number
}) => {
  return request({
    url: `/topical/list`,
    method: 'GET',
    data
  })
}

// 点赞
export const praise = (topicalId: string) => {
  return request({
    url: `/topical/praise/${topicalId}`,
    method: 'GET'
  })
}

// 创建案例
export const createCase = (data: {
  taskId: 2,
  name: '',
  type: 0,
  labels: '',
  disease: '',
  transfer: '',
  diagnosisTime: '',
  hospital: '',
  treatment: '',
  programme: '',
  status: '',
}) => {
  return request({
    url: `/case`,
    method: 'POST',
    data
  })
}
